<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic
  PUBLIC "-//OASIS//DTD DITA Composite//EN" "ditabase.dtd">
<topic id="topic1" xml:lang="en">
  <title id="gw141670">pg_opclass</title>
  <body>
    <p>The <codeph>pg_opclass</codeph> system catalog table defines index access method operator
      classes. Each operator class defines semantics for index columns of a particular data type and
      a particular index access method. An operator class essentially specifies that a particular
      operator family is applicable to a particular indexable column data type. The set of operators
      from the family that are actually usable with the indexed column are those that accept the
      column's data type as their left-hand input.</p>
    <p>An operator class's <codeph>opcmethod</codeph> must match the <codeph>opfmethod</codeph> of
      its containing operator family. Also, there must be no more than one <codeph>pg_opclass</codeph>
      row having <codeph>opcdefault</codeph> true for any given combination of
      <codeph>opcmethod</codeph> and <codeph>opcintype</codeph>.</p>
    <table id="gw141982">
      <title>pg_catalog.pg_opclass</title>
      <tgroup cols="4">
        <colspec colnum="1" colname="col1" colwidth="122.25pt"/>
        <colspec colnum="2" colname="col2" colwidth="78pt"/>
        <colspec colnum="3" colname="col3" colwidth="101.25pt"/>
        <colspec colnum="4" colname="col4" colwidth="147pt"/>
        <thead>
          <row>
            <entry colname="col1">column</entry>
            <entry colname="col2">type</entry>
            <entry colname="col3">references</entry>
            <entry colname="col4">description</entry>
          </row>
        </thead>
        <tbody>
          <row>
            <entry colname="col1">
              <codeph>oid</codeph>
            </entry>
            <entry colname="col2">oid</entry>
            <entry colname="col3"></entry>
            <entry colname="col4">Row identifier (hidden attribute; must be explicitly selected)</entry>
          </row>
          <row>
            <entry colname="col1">
              <codeph>opcmethod</codeph>
            </entry>
            <entry colname="col2">oid</entry>
            <entry colname="col3">pg_am.oid</entry>
            <entry colname="col4">Index access method operator class is for</entry>
          </row>
          <row>
            <entry colname="col1">
              <codeph>opcname</codeph>
            </entry>
            <entry colname="col2">name</entry>
            <entry colname="col3"/>
            <entry colname="col4">Name of this operator class</entry>
          </row>
          <row>
            <entry colname="col1">
              <codeph>opcnamespace</codeph>
            </entry>
            <entry colname="col2">oid</entry>
            <entry colname="col3">pg_namespace.oid</entry>
            <entry colname="col4">Namespace of this operator class </entry>
          </row>
          <row>
            <entry colname="col1">
              <codeph>opcowner</codeph>
            </entry>
            <entry colname="col2">oid</entry>
            <entry colname="col3">pg_authid.oid</entry>
            <entry colname="col4">Owner of the operator class</entry>
          </row>
          <row>
            <entry colname="col1">
              <codeph>opcfamily</codeph>
            </entry>
            <entry colname="col2">oid</entry>
            <entry colname="col3">pg_opfamily.oid</entry>
            <entry colname="col4">Operator family containing the operator class</entry>
          </row>
          <row>
            <entry colname="col1">
              <codeph>opcintype</codeph>
            </entry>
            <entry colname="col2">oid</entry>
            <entry colname="col3">pg_type.oid</entry>
            <entry colname="col4">Data type that the operator class indexes</entry>
          </row>
          <row>
            <entry colname="col1">
              <codeph>opcdefault</codeph>
            </entry>
            <entry colname="col2">boolean</entry>
            <entry colname="col3"/>
            <entry colname="col4">True if this operator class is the default for the data type
              <codeph>opcintype</codeph></entry>
          </row>
          <row>
            <entry colname="col1">
              <codeph>opckeytype</codeph>
            </entry>
            <entry colname="col2">oid</entry>
            <entry colname="col3">pg_type.oid</entry>
            <entry colname="col4">Type of data stored in index, or zero if same as
              <codeph>opcintype</codeph></entry>
          </row>
        </tbody>
      </tgroup>
    </table>
  </body>
</topic>
